import os

from auto_frame.base import Base
from page.contact_page import ContactPage


class AddMemberPage(Base):
    '''
    ele_name = (By.ID, 'username')  #姓名
    ele_account = (By.ID, 'memberAdd_acctid') #账号
    ele_phone = (By.ID, 'memberAdd_phone') #手机
    ele_modify_department = (By.CSS_SELECTOR, '.js_party_select_result > a')#修改部门
    ele_save_to_add_member = (By.CSS_SELECTOR, '.qui_btn.ww_btn.ww_btn_Blue.js_btn_continue') #保存并继续添加
    ele_save_add_member = (By.CSS_SELECTOR,'.qui_btn.ww_btn.js_btn_save') #保存
    '''
    def __init__(self, driver):
        super(AddMemberPage, self).__init__(driver)
        cur_path = os.path.abspath(os.path.dirname(__file__))  # 获取当前文件目录
        root_path = os.path.dirname(cur_path)
        self.step_path = f'{root_path}/steps/add_member_page.yaml'

    #输入必填项添加成员，暂时只考虑点击保存按钮情况
    def add_simple_member(self, data_dict:dict):
        self.steps(self.step_path, "add_simple_member", data_dict)
        return ContactPage(self.driver)

    #输入非必填项添加成员
    def add_detail_member(self):
        pass

    #跳转到通讯录页面
    def goto_contact_page(self):
        pass

    #修改部门,先占坑，后续实现
    def modify_department(self):
        pass
